//
//  HttpResponse.m
//  海角音乐
//
//  Created by dllo on 15/8/21.
//  Copyright (c) 2015年 杨元石. All rights reserved.
//

#import "HttpResponse.h"

@implementation HttpResponse



+ (void)urlString:(NSString *)urlString getResponseObject:(HttpAFNetworing)getResponseObject
{
    
    AFNetworkReachabilityManager *netWorkManager = [AFNetworkReachabilityManager sharedManager];
    
    NSString *url_string = [NSString stringWithString:urlString];
    
    AFHTTPRequestOperationManager* manager = [AFHTTPRequestOperationManager manager];
    
    manager.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"text/plain",@"text/json",@"application/json",@"text/javascript",@"text/html", @"application/x-javascript",nil];
    
    [manager GET:url_string parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) {
        [netWorkManager stopMonitoring];
        
        getResponseObject(responseObject);
        
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        
        NSLog(@"失败==== %@",error);
        
        
        
        
        
    }];
    
    
    
}

@end
